//
// Created by 郝羽 on 2018/6/7.
//

#ifndef RTC_XSWITCH2_SENDER_H
#define RTC_XSWITCH2_SENDER_H

#include <cstdint>
#include <list>
#include <vector>

struct BatchMessage {
    unsigned char* buffer;
    int            buffer_size;
    int64_t        start_time;
};

struct BatchSender {
    char* id;
    std::list<BatchMessage> messages;
    int packets;
    int duration;
};

BatchSender* BatchSenderNew(const char* id, int packets, int duration);

void BatchSenderDelete(BatchSender *);

void BatchSenderAppend(BatchSender*, const unsigned char*, int);

bool BatchSenderGetMessages(BatchSender*, std::vector<BatchMessage>&);

void BatchSenderFreeMessages(BatchSender*, std::vector<BatchMessage>&);

#endif //RTC_XSWITCH2_SENDER_H
